<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            background-color: pink;
        }
    </style>
</head>
<body>
    <div>123</div>
    <ul>
        <li>abc</li>
        <li>abcd</li>
        <li>abcde</li>
    </ul>
    <script>
        //e.target 返回的是触发事件的对象(元素) this 返回的是绑定事件的对象(元素)
        //区别: e.target 点击了哪个元素就返回哪个元素  this name元素绑定了这个点击事件，就返回谁
        var div = document.querySelector('div');
        div.addEventListener('click', function(e){
            e = e || window.event
            console.log(e.target);
        })

        var ul = document.querySelector('ul');
        ul.addEventListener('click', function(e){
            console.log(e.target);
            console.log(this);
        })
    </script>
</body>
</html>